package common.project.epic.db;

import java.util.Date;

public class EpicDevice implements Comparable{

	private String mac;
	private String name;
	private short rssi;
	private int expiry ;
	private int discovered_at;
	private int contact_at;

	public String getMac() {
		return mac;
	}
	
	public void setMac(String mac) {
		this.mac = mac;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public void setRssi(short rssi) {
		this.rssi = rssi;
	}

	public short getRssi() {
		return rssi;
	}

	public void setExpiry(int expiry) {
		this.expiry = expiry;
	}

	public int getExpiry() {
		return expiry;
	}

	public void setDiscovered_at() {
		Date now = new Date();
        Long longTime = new Long(now.getTime()/1000);
		this.discovered_at = longTime.intValue();
	}

	public int getDiscovered_at() {
		
		return discovered_at;
	}

	public void setContact_at(int contact_at) {
		this.contact_at = contact_at;
	}

	public int getContact_at() {
		return contact_at;
	}

	@Override
	public int compareTo(Object arg0) {
		
		EpicDevice ed = (EpicDevice) arg0;
		if(this.getRssi()>ed.getRssi()){return -1;}
		else if(this.getRssi()<ed.getRssi()){return 1;}
		else{return 0;}
		
		
	}
}
